pub fn convert_base(num_str: &str, to_base: u32) -> String {
    // TODO: 这里写逻辑
    // todo!()
    let parts: Vec<&str> = num_str.split('(').collect();

    let trimmed_num: &str = parts[0].trim();
    let from_base: u32 = parts[1].trim().trim_end_matches(')').parse().unwrap();

    let decimal = u32::from_str_radix(trimmed_num, from_base).unwrap();

    if decimal == 0 {
        return "0".to_string();
    }

    let mut n = decimal;

    let mut result = Vec::new();

    while n > 0 {
        let digit = n % to_base;
        result.push(digit);
        n /= to_base;
    }

    result.reverse();
    result.iter().map(|&d| {
        if d < 10 {
            (b'0' + d as u8) as char
        } else {
            (b'a' + (d - 10) as u8) as char
        }
    }).collect()
}
